namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;
    
    
    [System.SerializableAttribute()]
    [RelationMap("DELIVERY_ROUTE", typeof(DELIVERY_ROUTE), "a")]
    [Relation(RelationJoinType.Inner, typeof(CUSTOMERS), "b", "a", "ID", "CUSTOMER_ID")]
    public class DELIVERY_ROUTE_VIEW : ObjectRow
    {
        public DELIVERY_ROUTE_VIEW() 
        {
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public DELIVERY_ROUTE_VIEW(System.Data.DataRow dataRow, ObjectTable parent) : 
                base(dataRow, parent) {
        }
        
        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected DELIVERY_ROUTE_VIEW(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
        }
        
        [Key("ID", TableAlias = "a")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("USER_ID", TableAlias = "a")]
        public decimal USERID
        {
            get
            {
                return (System.Decimal)GetValue("USERID");
            }
            set
            {
                SetValue("USERID", value);
            }
        }

        [Field("TRUCKS_CODE", TableAlias = "a")]
        public string TRUCKS_CODE
        {
            get
            {
                return (System.String)GetValue("TRUCKS_CODE");
            }
            set
            {
                SetValue("TRUCKS_CODE", value);
            }
        }

        [Field("CUSTOMER_ID", TableAlias = "a")]
        public decimal CUSTOMERID
        {
            get
            {
                return (System.Decimal)GetValue("CUSTOMERID");
            }
            set
            {
                SetValue("CUSTOMERID", value);
            }
        }

        [Field("ORDER_ID", TableAlias = "a")]
        public decimal ORDER_ID
        {
            get
            {
                return (System.Decimal)GetValue("ORDER_ID");
            }
            set
            {
                SetValue("ORDER_ID", value);
            }
        }


        [Field("STATUS", TableAlias = "a")]
        public int STATUS
        {
            get
            {
                try
                {
                    return (System.Int32)GetValue("STATUS");
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                SetValue("STATUS", value);
            }
        }

        [Field("PLAN_ST", TableAlias = "a")]
        public decimal PLAN_ST
        {
            get
            {
                return GetValue("PLAN_ST") == null ? 0 : (System.Decimal)GetValue("PLAN_ST");
            }
            set
            {
                SetValue("PLAN_ST", value);
            }
        }

        [Field("PLAN_ET", TableAlias = "a")]
        public decimal PLAN_ET
        {
            get
            {
                return GetValue("PLAN_ET") == null ? 0 : (System.Decimal)GetValue("PLAN_ET");
            }
            set
            {
                SetValue("PLAN_ET", value);
            }
        }

        [Field("ACTUAL_ST", TableAlias = "a")]
        public decimal ACTUAL_ST
        {
            get
            {
                return GetValue("ACTUAL_ST") == null ? 0 : (System.Decimal)GetValue("ACTUAL_ST");
            }
            set
            {
                SetValue("ACTUAL_ST", value);
            }
        }

        [Field("ACTUAL_ET", TableAlias = "a")]
        public decimal ACTUAL_ET
        {
            get
            {
                return GetValue("ACTUAL_ET") == null ? 0 : (System.Decimal)GetValue("ACTUAL_ET");
            }
            set
            {
                SetValue("ACTUAL_ET", value);
            }
        }

        [Field("PHOTO_ID", TableAlias = "a")]
        public string PHOTO_ID
        {
            get
            {
                return (System.String)GetValue("PHOTO_ID");
            }
            set
            {
                SetValue("PHOTO_ID", value);
            }
        }

        [Field("REMARK", TableAlias = "a")]
        public string REMARK
        {
            get
            {
                return (System.String)GetValue("REMARK");
            }
            set
            {
                SetValue("REMARK", value);
            }
        }

        [Field("DOMAIN_ID", TableAlias = "a")]
        public decimal DOMAIN_ID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAIN_ID");
            }
            set
            {
                SetValue("DOMAIN_ID", value);
            }
        }

        [Field("ACTIVE", TableAlias = "a")]
        public bool ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("LAST_UPDATER", TableAlias = "a")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME", TableAlias = "a")]
        public decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("NAME", TableAlias = "b")]
        public string CUSTOMERNAME
        {
            get
            {
                return (System.String)GetValue("CUSTOMERNAME");
            }
            set
            {
                SetValue("CUSTOMERNAME", value);
            }
        }
        
    }
}
